package com.liezh.builder;

import com.liezh.builder.build.ResourcePoolConfig;
import com.liezh.builder.build.User;
import com.liezh.builder.builder.RTFReader;
import com.liezh.builder.builder.TeXConverter;

public class Clinet {


    public static void main(String[] args) {
        TeXConverter teXConverter = new TeXConverter();
        RTFReader rtfReader = new RTFReader(teXConverter);
        rtfReader.parseRTF("font");
        System.out.println(teXConverter.getmTeXText().getFont());

        User user = User.builder().name("liezh").age(11).phone("111111").gender("M");
        System.out.println(user.toString());

        // 这段代码会抛出IllegalArgumentException，因为minIdle>maxIdle
        // 如果没有参数依赖判断，可以用lombok的@Builder实现而不需要写代码
        ResourcePoolConfig config = new ResourcePoolConfig.Builder()
                .setName("db-connection-pool")
                .setMaxTotal(16)
                .setMaxIdle(10)
                .setMinIdle(12)
                .build();
        System.out.println(config.toString());
    }


}
